package vip.xumy.core.pojo.com;

import lombok.Data;

/**
 * All rights reserved author:mengyxu date:2019年6月26日
 */

@Data
public class AjaxResponse {
	private boolean success;
	private String message;
	private Object data;

	public AjaxResponse(boolean success, String message) {
		this.success = success;
		this.message = message;
	}

	public AjaxResponse() {
		super();
	}

	public AjaxResponse(boolean success, String message, Object data) {
		this.success = success;
		this.message = message;
		this.data = data;
	}

	public static AjaxResponse successed(String msg) {
		return new AjaxResponse(true, msg);
	}

	public static AjaxResponse failed(String msg) {
		return new AjaxResponse(false, msg);
	}
	
	public static AjaxResponse successed() {
		return new AjaxResponse(true, "操作成功");
	}

	public static AjaxResponse failed() {
		return new AjaxResponse(false, "操作失败");
	}

}
